package com.example.gustavo.hello.net;

import com.example.gustavo.hello.model.HelloObj;

import retrofit.Callback;
import retrofit.client.Response;
import retrofit.http.Field;
import retrofit.http.FormUrlEncoded;
import retrofit.http.GET;
import retrofit.http.POST;
import retrofit.http.Path;
import rx.Observable;

/**
 * Created by gustavo on 2015/4/10.
 */
public interface RetrofitService {

    //获取http返回的response
    @GET("/stock/hello/echo/{str}")
    Observable<Response> getResponse(@Path("str") String str);

    //返回封装好的bean
    @GET("/stock/hello/echo/{str}")
    Observable<HelloObj> getList(@Path("str") String str);


    //post
    @FormUrlEncoded
    @POST("/")
    Observable<HelloObj> get(@Field("echo") String echo);

    //
    @GET("/stock/hello/echo/{str}")
    void getAsync(@Path("str") String str, Callback<String> callback);
}
